package de.unikoblenz.west.csxpoi.server;

public class EventSimilarity extends Similarity {

	
	/**
	 * Calculates the (asymmetric) similarity of two specified POIs linearly
	 * combining linguistic, spatial, and semantic simiarities.
	 * 
	 * @param target
	 *            the target POI
	 * @param base
	 *            the base POI
	 * @return a similarity value between 0 (minimum) and 1 (maximum)
	 * @throws SimilarityException
	 */
	@Override
	public double similarity(PoiWrapper target, PoiWrapper base)
			throws SimilarityException{
		
		// TODO: determine optimal weights

		double linguisticWeight = 1;
		double spatialWeight = 1;
		double semanticWeight = 1;
		double timeWeight = 1;
		
		
		
		//similarity for events - contains timely similarity
		return (linguisticWeight * linguisticSimilarity(target, base)
				+ spatialWeight * spatialSimilarity(target, base) + semanticWeight
				* semanticSimilarity(target, base) + timeWeight * temporarySimilarity(target, base))
				/ (linguisticWeight + spatialWeight + semanticWeight + timeWeight);} 


	}
